import axios from './axios'

// 客户通过rfid退货
export function rfidOut(data) {
  return axios({
    method: 'post',
    url: '/customerOutTotal/rfidOut',
    data
  })
}

// 减标
export function outSubtract(data) {
  return axios({
    method: 'put',
    url: '/customerOutTotal/subtract',
    data
  })
}

// 清空
export function outEmpty(params) {
  return axios({
    method: 'delete',
    url: '/customerOutTotal/empty',
    params
  })
}

// 确认退货的数据
export function affirmOut(data) {
  return axios({
    method: 'post',
    url: '/customerOutTotal/affirmOut',
    data
  })
}

// 收货---直营店相关
export function receipt(data) {
  return axios({
    method: 'put',
    url: '/customerOutTotal/receipt',
    data
  })
}

// 客户退货（新建资料）继续录入
export function outByKindsNumberContinue(data) {
  return axios({
    method: 'post',
    url: '/customerOutTotal/outByKindsNumberContinue',
    data
  })
}

// 确认后补单
export function patchByAffirm(data) {
  return axios({
    method: 'post',
    url: '/customerOutTotal/patchByAffirm',
    data
  })
}

// 客户退货(新建资料) 保存
export function kindsNumberOut(data) {
  return axios({
    method: 'post',
    url: '/customerOutTotal/outByKindsNumber',
    data
  })
}

// 客户退货查询（多条件）
export function getOutInquire(params) {
  return axios({
    url: '/customerOutTotal/getOutInquire',
    params
  })
}

// 按单个序号查询客退详情
export function getInfoByOutSequence(params) {
  return axios({
    url: '/customerOutTotal/getInfoByOutSequence',
    params
  })
}

// 查询调整过售价的信息
export function getAdjustmentSellingPrice() {
  return axios({
    url: '/customerOutTotal/getAdjustmentSellingPrice'
  })
}

// 审核
export function checkYse(data) {
  return axios({
    method: 'put',
    url: '/customerOutTotal/checkYse',
    data
  })
}

// 反审
export function checkNo(data) {
  return axios({
    method: 'put',
    url: '/customerOutTotal/checkNo',
    data
  })
}

// 客户整进
export function allOut(data) {
  return axios({
    method: 'put',
    url: '/customerOutTotal/allOut',
    data
  })
}

// 厂商整退
export function retreat(params) {
  return axios({
    method: 'post',
    url: '/customerOutTotal/retreat',
    params
  })
}

// 改单编辑查询（货号，客退序号）
export function getUpdateReceipt(params) {
  return axios({
    method: 'put',
    url: '/customerOutTotal/getUpdateReceiptByKindsNumberAndOutSequence',
    params
  })
}

// 确认改单数据  （数量=改动数量-原数量 （前端计算））
export function affirmUpdateReceipt(data) {
  return axios({
    method: 'put',
    url: '/customerOutTotal/affirmUpdateReceipt',
    data
  })
}

// 确定后修改数据
export function updateByAffirm(data) {
  return axios({
    method: 'put',
    url: '/customerOutTotal/updateByAffirm',
    data
  })
}

// 删除退货数据（客户编号，客退序号，是否全选需封装进数据）
export function deleteOut(data) {
  return axios({
    method: 'delete',
    url: '/customerOutTotal/deleteOut',
    data
  })
}

// 确认后删除数据
export function deleteOutAffirm(data) {
  return axios({
    method: 'delete',
    url: '/customerOutTotal/deleteByAffirm',
    data
  })
}

// /manufacturer-out-total/Reeeenoprrrtwy
// 厂商退货更新虚拟库存
// 厂商退货汇总表
// （下面这个不是我注释）
//判断库存够不够
export function getNumber(data) {
  return axios({
    method: 'put',
    url: '/manufacturer-out-total/renewRepertory',
    data
  })
}

// 这个是修改的，点击继续录入的时候，发起api的接口
export const continue_to_enterApi = (data) => {
  return axios({
    method: 'POST',
    url: '/warehouse-differ/insert',
    data
  })
}

// 导入
export function importCustomerOut(data) {
  return axios({
    method: 'POST',
    url: '/customerOutTotal/importCustomerOut',
    data
  })
}
